package com.spukmk3me.impl.libgdx;

import com.spukmk3me.io.FileHandle;
import com.spukmk3me.resource.Resource;
import com.spukmk3me.resource.ResourceCreator;

public class LibgdxResourceCreator implements ResourceCreator
{
    @Override
    public String[] getSupportedTypes()
    {
        return SUPPORTEDTYPES;
    }

    @Override
    public Resource createResource( FileHandle handle, String type )
    {
        if ( type.equals( SUPPORTEDTYPES[ 0 ] ) )
            return new LibgdxImage();
        else if ( type.equals( SUPPORTEDTYPES[ 1 ] ) )
            return new LibgdxSound();
        else if ( type.equals( SUPPORTEDTYPES[ 2 ] ) )
            return new LibgdxMusic();
        
        return null;
    }
    
    public static final String[] SUPPORTEDTYPES = {
        "image",
        "sound",
        "music"
    };
}
